package com.geek.factory.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.geek.factory.entity.BizLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 业务操作日志Mapper接口
 *
 * @author author
 * @since 2025-06-26
 */
@Mapper
public interface BizLogMapper extends BaseMapper<BizLog> {
    /**
     * 查询平均执行时间
     */
    @Select("SELECT AVG(time_cost_ms) FROM biz_log ${ew.customSqlSegment}")
    Double selectAvgTimeCost(@Param("ew") QueryWrapper<BizLog> queryWrapper);
}